package com.seer.auto.dto;

public enum ErrorCode {
    SUCCESS("success"), INVALID_ARGUMENT("invalid_argument"), PERMISSION_DENIED("permission_denied"),
    NOT_FOUND("not_found"), ALREADY_EXISTS("already_exists"), UNAUTHENTICATED("unauthenticated"), UNKNOWN("unknown"),
    UNIMPLEMENTED("unimplemented"), FAILED_UPLOAD("failed_upload");

    private String msg = "";

    private ErrorCode(String msg) {
        this.msg = msg;
    }
    private Integer getCode() {
        return this.ordinal();
    }

    public String getMsg() {
        return this.msg;
    }

    public ErrorResp with(String msg) {
        ErrorResp err = new ErrorResp();
        err.setCode(this.getCode());
        err.setMessage(msg);
        return err;
    }
}